function Report = ValidateStructLike(SVariables,Object,ErrorWhenFail,ErrorFun)
AllSuccess=true;
for V=1:numel(SVariables)
	Var=SVariables{V};
	VarName=Var.name;
	if isfield(Object,VarName)
		try
			SubReport=RecursiveValidate(Object.(VarName),Var,ErrorWhenFail);
		catch ME
			error(ME.identifier,['.' VarName ME.message]);
		end
		if ~isequal(SubReport,true)
			AllSuccess=false;
		end
		Report.(VarName)=SubReport;
	else
		if isfield(Var,'kind')
			VarKind=Var.kind;
		else
			VarKind='required';
		end
		if strcmp(VarKind,'required')
			if ErrorWhenFail
				ErrorFun(VarName);
			else
				Report.(VarName)=missing;
				AllSuccess=false;
			end
		else
			Report.(VarName)=missing;
		end
	end
end
if AllSuccess
	Report=true;
end